package com.weipt.juc.function;

import java.util.Comparator;

/**
 * @author peter.wei 2020/09/28 16:46
 * @version 1.0
 * @company 终生学习
 * @description <br>peter.wei 2020/09/28 16:46
 **/
public class TestComparator {

    public static void main(String[] args) {
        Comparator<String> innerComparator = new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return o1.compareTo(o2);
            }
            /*@Override
            public boolean equals(Object obj) {
                return obj.toString().equals("peter");
            }*/
        };
        System.out.println(innerComparator.compare("1", "2"));

        Comparator<String> comparator = (o1,o2)->o1.compareTo(o2);
        comparator.compare("1","2");
    }
}